<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>lesson 29</title>
  <script src="https://unpkg.com/vue@next"></script>

</head>
<body>
  <div id="root"></div>
</body>
<script>
  // todo 自定义指令 directive
  const app = Vue.createApp({
    data() {
      return {
        num: 1,
      }
    },

    mounted() {
      this.$refs.input.focus(); // input框 自动聚焦
    },

    methods: {
      handleClick(){
        // this.num += 1;
      }
    },

    template: `
      <div>
        <input type="text" ref="input">
      <div>
        <input type="text" ref="input1">
        <button @click="handleClick">add</button>
      </div>
      </div>
    `
  });

  app.component('child',{
    template: "<div>{{count}}</div>"
  })



  const vm = app.mount('#root');
</script>
</html>